using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Device
{
	public class LocationLogicalState
	{
		public const int _AVAILABLE = 0;
		public const int _UNAVAILABLE = 1;
		private int _value;
		private static int _size;
		private static LocationLogicalState[] _array;
		public static string[] displayStrings;
		public static LocationLogicalState[] displayValues;
		public static LocationLogicalState AVAILABLE;
		public static LocationLogicalState UNAVAILABLE;
		public static LocationLogicalState IT_ENUM_MAX;
		static LocationLogicalState()
		{
			LocationLogicalState._size = 2;
			LocationLogicalState._array = new LocationLogicalState[LocationLogicalState._size];
			LocationLogicalState.displayStrings = new string[LocationLogicalState._size];
			LocationLogicalState.displayValues = new LocationLogicalState[LocationLogicalState._size];
			LocationLogicalState.AVAILABLE = new LocationLogicalState(0);
			LocationLogicalState.UNAVAILABLE = new LocationLogicalState(1);
			LocationLogicalState.IT_ENUM_MAX = new LocationLogicalState(2147483647);
			LocationLogicalState.displayStrings[0] = "AVAILABLE";
			LocationLogicalState.displayStrings[1] = "UNAVAILABLE";
			LocationLogicalState.displayValues[0] = LocationLogicalState.AVAILABLE;
			LocationLogicalState.displayValues[1] = LocationLogicalState.UNAVAILABLE;
		}
		public static string ValueToString(LocationLogicalState val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = LocationLogicalState.displayStrings[0];
				break;
			case 1:
				result = LocationLogicalState.displayStrings[1];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static LocationLogicalState StringToValue(string val)
		{
			LocationLogicalState result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = LocationLogicalState.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < LocationLogicalState.displayStrings.Length; i++)
				{
					if (val.Equals(LocationLogicalState.displayStrings[i]))
					{
						result = LocationLogicalState.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static LocationLogicalState From_Int(int value)
		{
			LocationLogicalState result;
			if (value >= 0 && value < LocationLogicalState._size)
			{
				result = LocationLogicalState._array[value];
			}
			else
			{
				result = LocationLogicalState.IT_ENUM_MAX;
			}
			return result;
		}
		protected LocationLogicalState(int value)
		{
			this._value = value;
			if (value >= 0 && value < LocationLogicalState._size)
			{
				LocationLogicalState._array[this._value] = this;
			}
		}
		public bool Equals(LocationLogicalState otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return LocationLogicalState.displayStrings[this._value];
		}
	}
}
